#include <stdio.h>
#include <string.h>
//
// Created by hi on 25-5-8.
//
struct Student {
    int id;
    char name[10];
    int age;
} ;
typedef struct Student Student;
void main() {

    //直接初始化，后再赋值
    Student student;
    //赋值id
    student.id = 1;
    //赋值age
    student.age = 18;
    //赋值字符串
    strcpy(student.name, "John");
    printf("赋值的是%s",student.name);
    //初始化赋值
    Student student2 = {2,"dzb",19};
    printf("student.id:%d\n",student2.id);
    printf("student.name:%s\n",student2.name);
    printf("student.age:%d\n",student2.age);

    //把结构体初始化为数组
    Student student3[2] ={{1,"hello"},{2,"world"}};
}